package com.jl.card.util;

public class SimpleTag {

	public byte tag;
	public boolean isCRSet;

	public SimpleTag(byte tag, boolean isCRSet) {
		this.tag = tag;
		this.isCRSet = isCRSet;
	}

	public byte getTag(boolean isCRSet) {
		return (byte) (isCRSet ? tag | 0x80 : tag & 0x7F);
	}

	@Override
	public boolean equals(Object obj) {
		if (super.equals(obj)) {
			return true;
		} else if (!(obj instanceof SimpleTag)) {
			return false;
		} else {
			return (tag & 0x7F) == (((SimpleTag) obj).tag & 0x7F);
		}
	}

}
